Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for canceling resumable uploads #1813

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

kawmra
Copy link
Contributor

@kawmra kawmra commented Nov 16, 2024

Closes #1767

This PR adds support for canceling resumable uploads.
The implementation is based on the guides and observed behavior, as this functionality was not explicitly documented in the API references.

I'm new to Go, so please feel free to let me know if you have any concerns about naming conventions, code organization, or anything else.

Thanks for maintaining this great project!

Comment on lines +633 to +635
func (s *Server) deleteResumableUpload(r *http.Request) jsonResponse {
return jsonResponse{status: 499}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, if a non-existent session URI is specified, the server should return a 404, and a PUT request for a deleted session URI should respond with 499. However, since the upload process did not seem to specifically check whether the session URI actually exists, I decided to follow that approach and not pursue this level of reality.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a fair trade-off.

Copy link
Owner

@fsouza fsouza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing and sorry for the slow review turn around.

Comment on lines +633 to +635
func (s *Server) deleteResumableUpload(r *http.Request) jsonResponse {
return jsonResponse{status: 499}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a fair trade-off.

@fsouza fsouza merged commit ab0a11a into fsouza:main Jan 3, 2025
38 checks passed
@kawmra kawmra deleted the delete-resumable-upload branch January 7, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canceling resumable upload is not supported?
2 participants